import Dialog from '../../miniprogram_npm/@vant/weapp/dialog/dialog';

const app = getApp()
Component({
	/**
	 * Component properties
	 */
	properties: {
		navs:{
			type:Array,
			value:[]
		}
	},

	/**
	 * Component initial data
	 */
	data: {
		isFold:true
	},
	/**
	 * Component methods
	 */
	methods: {
		onClickAdd: function (e) {
			if(app.globalData.openid!='')
			{
				this.setData({
					isFold: !this.data.isFold
				})
				if(this.data.isFold) {
					this.setData({
						maskAnimation: 'maskClose',
						btnAnimation: 'menuClose'

					})
				} else {
					this.setData({
						maskAnimation: 'maskOpen',
						btnAnimation: 'menuOpen'
					})
				}
		}
		else
		{
			Dialog.alert({
        message: '请您先登录',
      }).then(() => {
        wx.switchTab({
          url: '../../pages/mine/index',
        })
      });
		}
		},
		preventdefault: function () {

		}
	}
})
